#ifndef ZPOINT_CLOUD_H_
#define ZPOINT_CLOUD_H_

#include <Common/GlobalDefines.h>
#include <Math/vectorN.h>
#include <Render/ZColor.h>
#include <vector>

GLOBAL_NAMESPACE_BEGIN

namespace MeshSpace
{
    typedef MATH::vector3d Vec3d;
    struct PcPoint
    {
        Vec3d pos;
        Color color;
    };

    class PointCloud
    {
    public:
        PointCloud();
        ~PointCloud();

        bool loadFromFile(const char* fileName);

        int     getPointSize();
        PcPoint getPointAt(int idx);
        void    setPointPositionAt(int idx, const Vec3d& pos);
        void    setPointColorAt(int idx, const Color& col);

    private:
        bool checkIndexValid(int checkId);
        void clearData();
        void insertPoint(const Vec3d& pos);

    private:
        std::vector<PcPoint> points_;
    };

}


GLOBAL_NAMESPACE_END

#endif//ZPOINT_CLOUD_H_